package chapter07

import scala.collection.immutable
import scala.collection.parallel.immutable.ParSeq

/**
  * create by undeRdoG on  2021-06-06  13:07
  * 凡心所向，素履以往，生如逆旅，一苇以航。
  */
object Test20_Parallel {

  def main(args: Array[String]): Unit = {
    val result: immutable.IndexedSeq[String] = (1 to 100).map(
      x => Thread.currentThread().getName
    )
    println(result)


    val result2: ParSeq[String] = (1 to 100).par.map(
      x => Thread.currentThread().getName
    )
    println(result2)
  }
}
